<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Wally The Sentry Bot: Code for Wally</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Wally The Sentry Bot
   &#160;<span id="projectnumber">0.2</span>
   </div>
   <div id="projectbrief">A silly Arduino project to play with sensors, Xbees and a Peggy 2.0 pegboard</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('group___wally.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#define-members">Defines</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">Code for Wally</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab48713ed1fc80823381cb0c175a22226"></a><!-- doxytag: member="Wally::I2CaddrRTC" ref="gab48713ed1fc80823381cb0c175a22226" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#gab48713ed1fc80823381cb0c175a22226">I2CaddrRTC</a>&#160;&#160;&#160;0x68</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">I2C address for RTC. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaa9b648d9daf17e23784b2057f2510154"></a><!-- doxytag: member="Wally::I2CaddrRAM" ref="gaa9b648d9daf17e23784b2057f2510154" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#gaa9b648d9daf17e23784b2057f2510154">I2CaddrRAM</a>&#160;&#160;&#160;0x0A</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">I2C address for RAM. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga45e46be398229acec330371dd6c74c50"></a><!-- doxytag: member="Wally::IRpin" ref="ga45e46be398229acec330371dd6c74c50" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga45e46be398229acec330371dd6c74c50">IRpin</a>&#160;&#160;&#160;A0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">analog pin A0 for reading the IR sensor (ORANGE) <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga922b133f00a73d6baf4852735be6df91"></a><!-- doxytag: member="Wally::LSpin" ref="ga922b133f00a73d6baf4852735be6df91" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga922b133f00a73d6baf4852735be6df91">LSpin</a>&#160;&#160;&#160;A1</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">analog pin A1 for reading the line scanner sensor <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga019e754c756db6ed19d15c5c495e7896"></a><!-- doxytag: member="Wally::xbeeRX" ref="ga019e754c756db6ed19d15c5c495e7896" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga019e754c756db6ed19d15c5c495e7896">xbeeRX</a>&#160;&#160;&#160;2</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">digital pin 2 for Xbee UART receive <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gae0d7ee196d1881dc17583655079ed0ee"></a><!-- doxytag: member="Wally::xbeeTX" ref="gae0d7ee196d1881dc17583655079ed0ee" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#gae0d7ee196d1881dc17583655079ed0ee">xbeeTX</a>&#160;&#160;&#160;3</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">digital pin 3 for Xbee UART transmit <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga3ce98078523dbaa5786ecc2439fc0a44"></a><!-- doxytag: member="Wally::soundPin" ref="ga3ce98078523dbaa5786ecc2439fc0a44" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga3ce98078523dbaa5786ecc2439fc0a44">soundPin</a>&#160;&#160;&#160;4</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">digital pin 4 for reading the sound impact sensor (GRAY) <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga42210bf463abb982e0ba7e66e9cf0524"></a><!-- doxytag: member="Wally::movementPin" ref="ga42210bf463abb982e0ba7e66e9cf0524" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga42210bf463abb982e0ba7e66e9cf0524">movementPin</a>&#160;&#160;&#160;5</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">digital pin 5 for reading the the movement sensor (XXXX WHITE?) <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga7c8d9220988a9ffa1bc35ef26c152d7b"></a><!-- doxytag: member="Wally::PINGpin" ref="ga7c8d9220988a9ffa1bc35ef26c152d7b" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga7c8d9220988a9ffa1bc35ef26c152d7b">PINGpin</a>&#160;&#160;&#160;7</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">digital pin 7 for reading the PING))) sensor (YELLOW) <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga58a46f380ee350cbfd6bcf2e028efdbe"></a><!-- doxytag: member="Wally::servoPin" ref="ga58a46f380ee350cbfd6bcf2e028efdbe" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga58a46f380ee350cbfd6bcf2e028efdbe">servoPin</a>&#160;&#160;&#160;9</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">digital pin 9 for controlling servo position (PURPLE) <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga013c3e4a50d0f3f66a295911df3cc0a2"></a><!-- doxytag: member="Wally::LSclockPin" ref="ga013c3e4a50d0f3f66a295911df3cc0a2" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga013c3e4a50d0f3f66a295911df3cc0a2">LSclockPin</a>&#160;&#160;&#160;10</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">digital pin 10 for controlling the line scanner clock signal (XXXXXXX) <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gafdf985a959f5c85d90cda182f3ed7763"></a><!-- doxytag: member="Wally::LSsyncPin" ref="gafdf985a959f5c85d90cda182f3ed7763" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#gafdf985a959f5c85d90cda182f3ed7763">LSsyncPin</a>&#160;&#160;&#160;11</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">digital pin 11 for controlling the line scanner sync signal (XXXXXXX) <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gad29f66110456ba86205034ad1232fca8"></a><!-- doxytag: member="Wally::laserPin" ref="gad29f66110456ba86205034ad1232fca8" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#gad29f66110456ba86205034ad1232fca8">laserPin</a>&#160;&#160;&#160;13</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">digital pin 13 to turn on/off laser (BROWN) <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gae56d8a3d3c65c31e0806603c89119c97"></a><!-- doxytag: member="Wally::sensorPING" ref="gae56d8a3d3c65c31e0806603c89119c97" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#gae56d8a3d3c65c31e0806603c89119c97">sensorPING</a>&#160;&#160;&#160;0</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">numerical representation of the PING))) sensor from Parallax <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gac9037282369cb98c25e1f5ecabf9fde7"></a><!-- doxytag: member="Wally::sensorIR" ref="gac9037282369cb98c25e1f5ecabf9fde7" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#gac9037282369cb98c25e1f5ecabf9fde7">sensorIR</a>&#160;&#160;&#160;1</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">numerical representation of the IR distance sensor from Sharp <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga5693c3de30d9155d123f797cb6799ecb"></a><!-- doxytag: member="Wally::servoMaxAngle" ref="ga5693c3de30d9155d123f797cb6799ecb" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga5693c3de30d9155d123f797cb6799ecb">servoMaxAngle</a>&#160;&#160;&#160;160</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Max servo angle (physical limitation at about 178) <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga9e6692d9a3b786f384e1059262aa1141"></a><!-- doxytag: member="Wally::NO_PIN_STATE" ref="ga9e6692d9a3b786f384e1059262aa1141" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga9e6692d9a3b786f384e1059262aa1141">NO_PIN_STATE</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">to indicate that you don't need the pinState (save RAM/speed on PinChangeInt.h) <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga23b79226e36eb691b9d7697368baf451"></a><!-- doxytag: member="Wally::NO_PIN_NUMBER" ref="ga23b79226e36eb691b9d7697368baf451" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga23b79226e36eb691b9d7697368baf451">NO_PIN_NUMBER</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">to indicate that you don't need the arduinoPin (save RAM/speed on PinChangeInt.h) <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga15f51e3ff78fd91ad93015ba59ff806b"></a><!-- doxytag: member="Wally::NO_PORTC_PINCHANGES" ref="ga15f51e3ff78fd91ad93015ba59ff806b" args="" -->
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga15f51e3ff78fd91ad93015ba59ff806b">NO_PORTC_PINCHANGES</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">to indicate that port c will not be used for pin change interrupts (save RAM/speed on PinChangeInt.h) <br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga38480955789631fe79ee2b9099774d89">writeRAM</a> (uint16_t, uint8_t)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Write a byte to external RAM connected via I2C.  <a href="#ga38480955789631fe79ee2b9099774d89"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">byte&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#gab59417c40c5c856c48949f7b6cd8ffad">readRAM</a> (uint16_t)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a byte from external RAM connected via I2C.  <a href="#gab59417c40c5c856c48949f7b6cd8ffad"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#gabe4b3ccd98a8c349cb3559bce2077427">getRTCtime</a> (uint8_t *)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Library for I2C (TWI) peripherals Currently supports: DS1307 Real Time Clock FM24C64B External RAM.  <a href="#gabe4b3ccd98a8c349cb3559bce2077427"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga5f1e53bd254c2520b9d4139aff0995bf"></a><!-- doxytag: member="Wally::setRTCtime" ref="ga5f1e53bd254c2520b9d4139aff0995bf" args="(void)" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga5f1e53bd254c2520b9d4139aff0995bf">setRTCtime</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the time for the real-time clock. Adjusts the time of the RTC Queries the RTC over I2C fof the current time. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga702580e86c6bb5a1ebe96375777a4d98">dec2bcd</a> (uint8_t)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts decimal to binary coded decimal (bcd)  <a href="#ga702580e86c6bb5a1ebe96375777a4d98"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#gac810634a32fef2651712d3ef3f579684">bcd2dec</a> (uint8_t)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts binary coded decimal (bcd) to decimal.  <a href="#gac810634a32fef2651712d3ef3f579684"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#gae5ae404da647e93afb3bee73104f5a75">sensorSweep</a> (uint8_t, uint8_t, uint8_t)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Perform a full servo rotation sensor sweep Can perform either an initial sweep to build up template array of distances, or run a normal sweep comparing those distances to the template A movement is defined as a deviation on *both* sensors at the same angle, which typically means we ignore the wider beam and thus earlier reports of the PING))) until the Sharp IR can confirm the find.  <a href="#gae5ae404da647e93afb3bee73104f5a75"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga60d6df90f89c52b974d466c7176e9aca">readSensor</a> (uint8_t)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Read sensor and report back distance.  <a href="#ga60d6df90f89c52b974d466c7176e9aca"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gabaf22846f68b3e777251efeaab449d9c"></a><!-- doxytag: member="Wally::xbeeSerial" ref="gabaf22846f68b3e777251efeaab449d9c" args="(xbeeRX, xbeeTX)" -->
SoftwareSerial&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#gabaf22846f68b3e777251efeaab449d9c">xbeeSerial</a> (<a class="el" href="group___wally.html#ga019e754c756db6ed19d15c5c495e7896">xbeeRX</a>, <a class="el" href="group___wally.html#gae0d7ee196d1881dc17583655079ed0ee">xbeeTX</a>)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">initialize software serial port on pins 2 and 3 for communication with XBee shield <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga4fc01d736fe50cf5b977f755b675f11d"></a><!-- doxytag: member="Wally::setup" ref="ga4fc01d736fe50cf5b977f755b675f11d" args="()" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga4fc01d736fe50cf5b977f755b675f11d">setup</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The Arduino setup function. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gafe461d27b9c48d5921c00d521181f12f"></a><!-- doxytag: member="Wally::loop" ref="gafe461d27b9c48d5921c00d521181f12f" args="()" -->
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#gafe461d27b9c48d5921c00d521181f12f">loop</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The Arduino main loop. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gab5b4ee834b0bc248c265b98fcf28f0e0"></a><!-- doxytag: member="Wally::getCamera" ref="gab5b4ee834b0bc248c265b98fcf28f0e0" args="()" -->
void&#160;</td><td class="memItemRight" valign="bottom"><b>getCamera</b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#gaee21f4f992fcc2005a01c1571bfd842c">detectedSound</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if we are right now hearing anything on the sound sensor.  <a href="#gaee21f4f992fcc2005a01c1571bfd842c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#gaf9053797c3c3d2f98e612c93db3edd79">detectedMovement</a> (void)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if we are right now are seeing anything via the hall sensor.  <a href="#gaf9053797c3c3d2f98e612c93db3edd79"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga2fe8083d832b2df82a4dbb30a386745d"></a><!-- doxytag: member="Wally::sensorTurret" ref="ga2fe8083d832b2df82a4dbb30a386745d" args="" -->
Servo&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga2fe8083d832b2df82a4dbb30a386745d">sensorTurret</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">set a variable to map the servo <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaeea7080fd7ec608976280a5db3d2f1ab"></a><!-- doxytag: member="Wally::turretAngle" ref="gaeea7080fd7ec608976280a5db3d2f1ab" args="" -->
uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#gaeea7080fd7ec608976280a5db3d2f1ab">turretAngle</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">variable to store the servo position (0 by default) <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga852b86a2eaee9852ada7a43e61e311a2"></a><!-- doxytag: member="Wally::index" ref="ga852b86a2eaee9852ada7a43e61e311a2" args="" -->
uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga852b86a2eaee9852ada7a43e61e311a2">index</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">the index of the current reading <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga3d89b3b175e3facfaf9dc73a3ecf1cd3"></a><!-- doxytag: member="Wally::timeDate" ref="ga3d89b3b175e3facfaf9dc73a3ecf1cd3" args="[4]" -->
uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga3d89b3b175e3facfaf9dc73a3ecf1cd3">timeDate</a> [4]</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Contains the current time and date. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga3b22777a5996fb0c93c9597b4f36f9ff"></a><!-- doxytag: member="Wally::lastMinute" ref="ga3b22777a5996fb0c93c9597b4f36f9ff" args="" -->
uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga3b22777a5996fb0c93c9597b4f36f9ff">lastMinute</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">keeps track of the current minute to time XBee updates <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gace1d568317f1c4a1a8e3ba46fcca2ec1"></a><!-- doxytag: member="Wally::DETECTED" ref="gace1d568317f1c4a1a8e3ba46fcca2ec1" args="" -->
boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#gace1d568317f1c4a1a8e3ba46fcca2ec1">DETECTED</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">have we found someone? <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga745cffeadcb6474faf373e638af93fea"></a><!-- doxytag: member="Wally::SOUND" ref="ga745cffeadcb6474faf373e638af93fea" args="" -->
boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga745cffeadcb6474faf373e638af93fea">SOUND</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">have we heard something? <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga3e033da76612d0bc5dc20d5bc6305f78"></a><!-- doxytag: member="Wally::MOVEMENT" ref="ga3e033da76612d0bc5dc20d5bc6305f78" args="" -->
boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga3e033da76612d0bc5dc20d5bc6305f78">MOVEMENT</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">have we seen something <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga55a73ec5f730578c6a84a6e50c409e87"></a><!-- doxytag: member="Wally::DEBUG" ref="ga55a73ec5f730578c6a84a6e50c409e87" args="" -->
const boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga55a73ec5f730578c6a84a6e50c409e87">DEBUG</a> = 1</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Increase reporting. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga0a62119651df155ee256d82601dcfeb4"></a><!-- doxytag: member="Wally::interruptDisable" ref="ga0a62119651df155ee256d82601dcfeb4" args="" -->
boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga0a62119651df155ee256d82601dcfeb4">interruptDisable</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">flag to disable/enable interrupts (possibly redundant with capacitors in place to prevent noise from sensors) <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga738c8636487cf9bd7f045ead07952fd3"></a><!-- doxytag: member="Wally::measurePING" ref="ga738c8636487cf9bd7f045ead07952fd3" args="[servoMaxAngle]" -->
uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#ga738c8636487cf9bd7f045ead07952fd3">measurePING</a> [<a class="el" href="group___wally.html#ga5693c3de30d9155d123f797cb6799ecb">servoMaxAngle</a>]</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Array for PING))) measurements. We only measure in 1 degree steps. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gad7efe61a5c34484d807ea7365ce27b3e"></a><!-- doxytag: member="Wally::measureIR" ref="gad7efe61a5c34484d807ea7365ce27b3e" args="[servoMaxAngle]" -->
uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___wally.html#gad7efe61a5c34484d807ea7365ce27b3e">measureIR</a> [<a class="el" href="group___wally.html#ga5693c3de30d9155d123f797cb6799ecb">servoMaxAngle</a>]</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Array for IR measurements. We only measure in 1 degree steps. <br/></td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gac810634a32fef2651712d3ef3f579684"></a><!-- doxytag: member="i2c_peripherals.cpp::bcd2dec" ref="gac810634a32fef2651712d3ef3f579684" args="(uint8_t)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t <a class="el" href="group___wally.html#gac810634a32fef2651712d3ef3f579684">bcd2dec</a> </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Converts binary coded decimal (bcd) to decimal. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">binary</td><td>coded decimal value </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>decimal value </dd></dl>

</div>
</div>
<a class="anchor" id="ga702580e86c6bb5a1ebe96375777a4d98"></a><!-- doxytag: member="i2c_peripherals.cpp::dec2bcd" ref="ga702580e86c6bb5a1ebe96375777a4d98" args="(uint8_t)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t <a class="el" href="group___wally.html#ga702580e86c6bb5a1ebe96375777a4d98">dec2bcd</a> </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Converts decimal to binary coded decimal (bcd) </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">decimal</td><td>value </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>binary coded decimal value </dd></dl>

</div>
</div>
<a class="anchor" id="gaf9053797c3c3d2f98e612c93db3edd79"></a><!-- doxytag: member="Wally.ino::detectedMovement" ref="gaf9053797c3c3d2f98e612c93db3edd79" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group___wally.html#gaf9053797c3c3d2f98e612c93db3edd79">detectedMovement</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Checks if we are right now are seeing anything via the hall sensor. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>0==Nothing to report, 1==Movement detected </dd></dl>

</div>
</div>
<a class="anchor" id="gaee21f4f992fcc2005a01c1571bfd842c"></a><!-- doxytag: member="Wally.ino::detectedSound" ref="gaee21f4f992fcc2005a01c1571bfd842c" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group___wally.html#gaee21f4f992fcc2005a01c1571bfd842c">detectedSound</a> </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Checks if we are right now hearing anything on the sound sensor. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>0==Nothing to report, 1==Sound detected </dd></dl>

</div>
</div>
<a class="anchor" id="gabe4b3ccd98a8c349cb3559bce2077427"></a><!-- doxytag: member="i2c_peripherals.cpp::getRTCtime" ref="gabe4b3ccd98a8c349cb3559bce2077427" args="(uint8_t *)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group___wally.html#gabe4b3ccd98a8c349cb3559bce2077427">getRTCtime</a> </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Library for I2C (TWI) peripherals Currently supports: DS1307 Real Time Clock FM24C64B External RAM. </p>
<p>Gets the time for the real-time clock. Queries the RTC over I2C fof the current time. </p>

</div>
</div>
<a class="anchor" id="gab59417c40c5c856c48949f7b6cd8ffad"></a><!-- doxytag: member="i2c_peripherals.cpp::readRAM" ref="gab59417c40c5c856c48949f7b6cd8ffad" args="(uint16_t)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t <a class="el" href="group___wally.html#gab59417c40c5c856c48949f7b6cd8ffad">readRAM</a> </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Read a byte from external RAM connected via I2C. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">word</td><td>address: Data address (16bit) </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>byte data: Data to wite </dd></dl>

</div>
</div>
<a class="anchor" id="ga60d6df90f89c52b974d466c7176e9aca"></a><!-- doxytag: member="Wally.h::readSensor" ref="ga60d6df90f89c52b974d466c7176e9aca" args="(uint8_t)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint16_t <a class="el" href="group___wally.html#ga60d6df90f89c52b974d466c7176e9aca">readSensor</a> </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>sensor</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Read sensor and report back distance. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">sensor</td><td>Number of the sensor to query distance from </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>distance Distance measured by sensor (capped at sensor max range) </dd></dl>

</div>
</div>
<a class="anchor" id="gae5ae404da647e93afb3bee73104f5a75"></a><!-- doxytag: member="Wally.h::sensorSweep" ref="gae5ae404da647e93afb3bee73104f5a75" args="(uint8_t, uint8_t, uint8_t)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t <a class="el" href="group___wally.html#gae5ae404da647e93afb3bee73104f5a75">sensorSweep</a> </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>startAngle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>endAngle</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>mode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Perform a full servo rotation sensor sweep Can perform either an initial sweep to build up template array of distances, or run a normal sweep comparing those distances to the template A movement is defined as a deviation on *both* sensors at the same angle, which typically means we ignore the wider beam and thus earlier reports of the PING))) until the Sharp IR can confirm the find. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8_t</td><td>startAngle The starting angle of the sensor sweep, normally 0 </td></tr>
    <tr><td class="paramname">uint8_t</td><td>endAngle The ending angle of the sensors sweep, normally servoMaxAngle </td></tr>
    <tr><td class="paramname">uint8_t</td><td>mode Scan mode, (r)eference, (s)can or (m)ovement </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>0==Nothing found, 1==Targe aqcuired </dd></dl>
<dl class="note"><dt><b>Note:</b></dt><dd>One weakness: if outside of the range of the Sharp we always report negative, as the PING is not alone to trigger a movement alert </dd></dl>

</div>
</div>
<a class="anchor" id="ga38480955789631fe79ee2b9099774d89"></a><!-- doxytag: member="i2c_peripherals.cpp::writeRAM" ref="ga38480955789631fe79ee2b9099774d89" args="(uint16_t, uint8_t)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="group___wally.html#ga38480955789631fe79ee2b9099774d89">writeRAM</a> </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Write a byte to external RAM connected via I2C. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">word</td><td>address: Data address (16bit) </td></tr>
    <tr><td class="paramname">byte</td><td>data: Data to wite </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div>
  <div id="nav-path" class="navpath">
    <ul>

    <li class="footer">Generated on Thu May 24 2012 00:05:01 for Wally The Sentry Bot by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
